from src.config import Config
from src.data_processor import DataProcessor
from src.trainer import Trainer

def main():
    # 初始化配置
    config = Config()
    
    # 初始化数据处理器
    data_processor = DataProcessor(config)
    
    # 加载数据
    train_df, test_df = data_processor.load_data()
    X_train = train_df['text']
    y_train = train_df['label']
    X_test = test_df['text']
    
    # 训练和预测
    trainer = Trainer(config, data_processor)
    predictions = trainer.train_and_predict(X_train, y_train, X_test)
    
    # 保存预测结果
    data_processor.save_submission(predictions)

if __name__ == '__main__':
    main() 